home *** CD-ROM | disk | FTP | other *** search
- Path: news.internex.net.au!usenet
- From: sultan@connexus.apana.org.au (Jon Hornstein)
- Newsgroups: comp.lang.c++
- Subject: Re: Floating Point Error Traping by try and catch:-
- Date: Fri, 22 Mar 1996 11:28:13 GMT
- Organization: Yarra House Software Pty Ltd
- Message-ID: <4iu0lv$1cd@preeda.internex.net.au>
- References: <4i836n$2u8@dfw-ixnews5.ix.netcom.com> <4iie9e$1pp@news5.erols.com>
- NNTP-Posting-Host: dialin-4.internex.net.au
- X-Newsreader: Forte Free Agent 1.0.82
-
- Chris Cobb <ccobb@cseg.com> wrote:
-
- >rajash@ix.netcom.com(Rajash Gopalakrishnan ) wrote:
- >>Hi Experts!.
- >>
- >>We were using normal try and catch statements to trap
- >>the exceptional errors occured during C++ class operation.
- >>We are working on Soaris C++ 4.1 with Toolsh++ classes.
- >>
- >[stuff deleted]
- >>Here what I found is that before catch, arithemetic experssion fault
- >>occurs and core is dumping. One method I found is to redirect the
- >>signal
- >>handler and do a catch but that's a round about method. Can anybody
- >>explain how we can handle this situation by try and catch alone. Is
- >>there
- >>any method to show where error occured and line#.
-
- >Well, it seems to me that a floating point error is a hardware trap
- >which you may be able to intercept with a signal function (I haven't
- >tried to catch one lately). Within your signal function you could
- >then perform a throw.
-
- My impression of a signal function is to treat it as a non-local goto
- much in the same vein as longjmp. Longjmp's do not cause the programs
- to unwind their stacks. With this in mind throwing an exception in a
- signal handler would cause the execution thread to be transferred to
- the unexpected throw handler. The try/catch block are effectively
- nullified by the non-local goto. I have't tried this please correct me
- if I am wrong!
-
-
-
-
-
-
-